package com.aaa.vo;

import java.util.List;

public class Result<T>{
    private Integer code;
    private String msg;
    private T data;
    private T extra;


    public Result() {
    }
    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Result(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public Result(Integer code, String msg, T data, T extra) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.extra = extra;
    }



    public Integer getCode() {
        return code;
    }

    public Result<T> setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Result<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public Result<T> setData(T data) {
        this.data = data;
        return this;
    }

    public T getExtra() {
        return extra;
    }

    public Result<T> setExtra(T extra) {
        this.extra = extra;
        return this;
    }
    public static<T> Result<T> success(){
        Result<T> respModel=new Result<>();
        respModel.setCode(2000);
        respModel.setMsg("success");
        return respModel;
    }
    public static<T> Result<T> error(){
        Result<T> respModel=new Result<>();
        respModel.setCode(1000);
        respModel.setMsg("error");
        return respModel;
    }


}
